<template>
  <div class="driverMsg">
    <div class="msg">
      <div class="left">
        <img :src="info.avatar" />
      </div>
      <div class="right">
        <div class="name__info">
          <span class="name">{{ info.name }}</span>
          <div class="validate" v-if="info.validate">已认证</div>
          <div class="validate" v-else>未认证</div>
        </div>
        <div class="phone">{{ info.phone }}</div>
      </div>
    </div>
    <div class="list__msg">
      <div class="item" v-for="(item, index) in msgList" :key="index">
        <span class="title">{{ item.title }}</span>
        <span class="description" :style="{ color: item.color ? item.color : '#101736' }">{{ item.description }}</span>
      </div>
    </div>
    <div class="label__area" v-show="carLabel.length > 0">
      <template v-for="(item, index) in carLabel" :key="index">
        <span class="memo">{{ item }}</span>
        <div class="line" v-show="index !== carLabel.length - 1"></div>
      </template>
    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent, reactive, ref, PropType } from 'vue'
import { DetailType, MsgType } from '../utils/types'

export default defineComponent({
  name: 'DriverMsg',
  components: {},
  props: {
    msgList: {
      type: Array as PropType<MsgType[]>,
      default: () => {
        return []
      }
    },
    info: {
      type: Object as PropType<DetailType>,
      default: () => {
        return {}
      }
    },
    carLabel: {
      type: Array,
      default: () => {
        return []
      }
    }
  },
  setup() {
    return {}
  }
})
</script>

<style lang="scss" scoped>
@import '@/style/variables.scss';
@import '@/style/mixins.scss';
.driverMsg {
  width: 100%;
  box-sizing: border-box;
  background: white;
  box-shadow: 0px 2px 10px 0px rgba(93, 184, 255, 0.07);
  border-radius: 10px;
  padding: 15px 10px 10px 10px;
  .msg {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #ededed;
    padding-bottom: 20px;
    .left {
      width: 48px;
      height: 48px;
      border-radius: 50%;
      overflow: hidden;
      box-shadow: 0px 2px 8px 0px rgba(192, 196, 201, 0.48);
      img {
        width: 100%;
      }
    }
    .right {
      width: calc(100% - 58px);
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      .name__info {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
      }
      .name {
        font-size: 16px;
        font-weight: 500;
        color: #101736;
        line-height: 22px;
        width: 210px;
        @include ellipsis;
      }
      .validate {
        padding: 1px 5px;
        height: 16px;
        background: rgba(255, 0, 79, 0.02);
        border-radius: 2px;
        border: 1px solid rgba(255, 0, 79, 0.5);
        font-size: 11px;
        font-weight: 400;
        color: #ff004f;
        line-height: 16px;
        text-align: center;
      }
      .phone {
        font-size: 14px;
        font-weight: 400;
        color: #575c72;
        line-height: 20px;
      }
    }
  }
  .list__msg {
    width: 100%;

    .item {
      padding-top: 15px;
      display: flex;
      justify-content: space-between;
    }
    .title {
      font-size: 14px;
      font-weight: 400;
      color: #575c72;
      line-height: 18px;
      width: 80px;
    }
    .description {
      font-size: 14px;
      font-weight: 400;
      color: #101736;
      width: calc(100% - 90px);
      text-align: right;
      line-height: 18px;
    }
  }
  .label__area {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    width: 100%;
    box-sizing: border-box;
    padding: 15px 4px 0 4px;
    padding-bottom: 15px;
    border-top: 1px solid #ededed;
    .memo {
      font-size: 14px;
      font-weight: 400;
      color: #575c72;
      line-height: 20px;
      display: block;
      // padding-left
    }
    .line {
      width: 1px;
      height: 12px;
      background: #9fa2af;
      margin: 0 10px;
    }
  }
}
</style>
